using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace SCSFContrib.CompositeUI.WinForms.SmartPartInfos
{
    public class NestedDockingShowStrategy : IShowStrategy
    {
        private Control neighbourSmartPart;
        private DockAlignment dockAlignment;
        private double proportion;

        public Control NeighbourSmartPart
        {
            get { return neighbourSmartPart; }
            set { neighbourSmartPart = value; }
        }

        public DockAlignment DockAlignment
        {
            get { return dockAlignment; }
            set { dockAlignment = value; }
        }

        public double Proportion
        {
            get { return proportion; }
            set { proportion = value; }
        }

        public NestedDockingShowStrategy(Control neighbourSmartPart, DockAlignment dockAlignment, double proportion)
        {
            this.neighbourSmartPart = neighbourSmartPart;
            this.dockAlignment = dockAlignment;
            this.proportion = proportion;
        }

        void IShowStrategy.Show(IDockPanelWorkspace workspace, IDockContent content)
        {
            DockPane pane = workspace.GetDockContent(NeighbourSmartPart).DockHandler.Pane;
            content.DockHandler.Show(pane, DockAlignment, Proportion);
        }
    }
}
